package com.study.system.controller;

import com.study.system.dto.ResultData;
import com.study.system.entity.Logger;
import com.study.system.service.LoggerService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/log")
public class LoggerController {
    // 获取日志
    @Resource
    private LoggerService log;

    @PostMapping("/clubLog")
    public ResultData<List<Logger>> getClubLog(@RequestBody Map<String, Integer> map) {
        return ResultData.success(log.getClubLog(map));
    }

    @GetMapping("/clubLogTotal")
    public ResultData<Integer> getClubLogTotal() {
        return ResultData.success(log.getClubTotal());
    }

    @PostMapping("/userLog")
    public ResultData<List<Logger>> getUserLog(@RequestBody Map<String, Integer> map) {
        return ResultData.success(log.getUserLog(map));
    }


    @GetMapping("/userLogTotal")
    public ResultData<Integer> getUserLogTotal() {
        return ResultData.success(log.getUserTotal());
    }
}
